﻿Public Class Frm2ClientesEditar
    Overloads Sub Show(ByVal p_ID As Integer, ByVal p_Cod As Integer, ByVal p_Nomb As String, ByVal p_Dir As String,
                       ByVal p_Doc As String, ByVal p_Tel As String, ByVal p_Email As String, ByVal p_Conta As String,
                       ByVal p_IdTsocio As String, ByVal frm2ClienteMenu As Frm2ClientesMenu)

        Me.lblIDSocio.Text = p_ID
        Me.lblCodigo.Text = p_Cod
        Me.txtNombre.Text = p_Nomb
        Me.txtDireccion.Text = p_Dir
        Me.txtCedula.Text = p_Doc
        Me.txtTelefono.Text = p_Tel
        Me.txtEmail.Text = p_Email
        Me.txtContacto.Text = p_Conta
        Me.lblIDTSocio.Text = p_IdTsocio

        Me.Show()
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()

    End Sub

    Private Sub Frm2ClientesEditar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim dato As New Socio
        Dim accion As New SocioDAO

        dato.pID = lblIDSocio.Text
        dato.pCod = lblCodigo.Text
        dato.pNombre = txtNombre.Text
        dato.pDirec = txtDireccion.Text
        dato.pDocu = txtCedula.Text
        dato.pTelefono = txtTelefono.Text
        dato.pEmail = txtEmail.Text
        dato.pContac = txtContacto.Text
        dato.pIdtsocio = lblIDTSocio.Text

        If accion.actualizar(dato) Then
            MessageBox.Show("Registro actualizado", "Modificar", MessageBoxButtons.OK, MessageBoxIcon.Information)

        Else
            MessageBox.Show("No se puede modificar el registro, contacte al administrador", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        End If
        Frm2ClientesMenu.Show()
        Me.Close()
    End Sub
End Class